Repository navigation
feat(viewer): closing the viewer window terminates the CLI - #168
Merged
Merged
Conversation
Add a non-blocking ViewerProcess::is_alive() probe (WaitForSingleObject on Windows, SpawnedChild::try_wait on POSIX) and treat viewer exit as a clean shutdown signal: the normal sketch watch loop checks liveness each 1s tick, and --serve-dir selects over Ctrl+C and a 1s liveness poll. Headless serve (--internal-serve-dir-headless) is unchanged — it never constructs a ViewerProcess, asserted via the new serve_dir_request() dispatch tests. Viewer crash and user close are treated identically and exit 0; in-flight compiles always finish before shutdown. Closes #167 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ViewerProcess::is_alive()probe:WaitForSingleObject(handle, 0)on Windows,SpawnedChild::try_wait()on POSIX (reap-safe — group kill-on-drop is best-effortkillpg).--serve-dir: replaced the barectrl_c().awaitwith atokio::select!over Ctrl+C and a 1s liveness poll.--internal-serve-dir-headless: unchanged (no viewer ever constructed); the newserve_dir_request()dispatch function + tests assert the headless path never launches a viewer.Closes #167
Test plan
soldr cargo test --workspace— 148 passed (new: liveness alive→dead probe tests on both Windows and POSIX cfgs, 3 serve_dir_request dispatch tests)soldr cargo fmt --all -- --checkcleansoldr cargo clippy --workspace --all-targetscleanuv run pytest tests/unit— 18 passed🤖 Generated with Claude Code